package masses;

import simulations.Simulation;
import java.awt.event.MouseEvent;


/**
 * Author: Zach Michaelov
 * Date: 9/23/12
 * Time: 3:24 PM
 */
public class ClickAndDragMass extends Mass {
    private MouseEvent event;

    /**
     * @param id
     * @param x
     * @param y
     * @param event
     */
    public ClickAndDragMass (int id, double x, double y, MouseEvent event) {
        super(id, x, y, 0);
        this.event = event;
    }

    @Override
    public void update (final Simulation simulation, final double dt) {
        // set the center to wherever the mouse position is
        this.setCenter(event.getX(), event.getY());

    }

    /**
     * allows us t
     * 
     * @param event
     */
    public void setEvent (final MouseEvent event) {
        this.event = event;
    }
}
